<template>
  <div>
    <Row>
      <Col :xs="{span: 24 }" :sm="{span: 10}" :md="{span: 6}" :lg="{span: 24}">
      <Menu mode="horizontal" :theme="theme1" @onselect="onMenuSelect">
        <Submenu name="product" style="margin-left: 40px">
          <template slot="title">
            <Icon type="ios-stats" />
            产品中心
          </template>
          <MenuGroup v-for="(item) in subjectList" :title="item.title">

            <MenuItem v-for="product in item.classesEntityList" :name="product.id">{{product.context}}</MenuItem>
            <!--<MenuItem name="3-2">点胶机</MenuItem>-->
            <!--<MenuItem name="3-3">螺丝机</MenuItem>-->
          </MenuGroup>
          <!--<MenuGroup title="应用方案">-->
            <!--<MenuItem name="3-4">自动螺丝机</MenuItem>-->
            <!--<MenuItem name="3-5">客户现场案例</MenuItem>-->
          <!--</MenuGroup>-->
        </Submenu>
        <Submenu name="company">
          <template slot="title">
            <Icon type="ios-stats" />
            关于我们
          </template>
          <MenuGroup title="公司介绍">
            <MenuItem name="4-1">公司简介</MenuItem>
            <MenuItem name="4-2">人才招聘</MenuItem>
          </MenuGroup>
        </Submenu>
      </Menu>
      </Col>
    </Row>
    <br>
  </div>
</template>
<script>
  import {getCategoryList} from '@/request/categoryRequest'
  import {getGoodsByClasses} from '@/request/goodsRequest'
  export default {
    data() {
      return {
        // menuList: [],
        subjectList: [],
        theme1: 'dark',
        page: 1,
        pageSize: 10,
        categoryPage: 1,
        categoryPageSize: 10,

      }
    },
    activated() {

    },
    created() {
      this.getDataList()
    },
    methods: {
      getDataList() {
      getCategoryList(this.page,this.pageSize).then( res =>{
        this.subjectList = res.data.data;
      });




    },
    onMenuSelect(name){
      // getGoodsByClasses(name,)
    },
    },

  }
</script>
<style>
  .headMenu{
    margin-top: 20px;
  }
</style>
